package com.logic.service;

import java.util.List;

import org.primefaces.model.chart.BarChartModel;
import org.primefaces.model.chart.BubbleChartModel;
import org.primefaces.model.chart.LineChartModel;
import org.primefaces.model.chart.PieChartModel;

import com.database.bean.BaseBean;
import com.database.bean.CompanyProduct;
import com.database.bean.Game;
import com.database.bean.Product;
import com.database.bean.Report;
import com.database.bean.Round;
import com.database.bean.User;
import com.math.util.StatisticBean;

public interface CompanyService  extends BaseService<BaseBean> {

	public abstract List<Product> getAllProducts();
	
	public abstract List<Product> getAllActiveProducts();
	
	public abstract List<CompanyProduct> getAllCompanyProducts();
	
	public abstract List<Report> getAllReports();
	
	/**
	 *  Get different products with sellings equal deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameProductSellings(Game game, Round deadlineRound);
	
	/**
	 * Get number of agents with specific preferenceImage equal deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameAgentImage(Game game, Round deadlineRound);
	
	/**
	 * Get number of agents with specific preferencePrice equal deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameAgentPrice(Game game, Round deadlineRound);
	
	/**
	 * Get number of agents with specific preferenceQuality equal deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameAgentQuality(Game game, Round deadlineRound);
	/**
	 * Get the whole amount of sold products of a company before deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameCompanySellings(Game game, Round deadlineRound);
	
	/**
	 * Get the round amount of sold products of a company before deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BarChartModel getMarketGameCompanySellingsPerRound(Game game, Round deadlineRound);
	
	/**
	 * Get the round amount of sold products of a company before deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract LineChartModel getMarketGameCompanySellingsPerRoundLineChart(Game game, Round deadlineRound);
	
	/**
	 * Shows how many sellings every company has in a specific round (=deadlineRound)
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract PieChartModel getMarketLastRoundSellingsPie(Game game, Round deadlineRound);
	
	/**
	 * Get the different products equal deadlineRound with sellings (amountSold)
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public abstract BubbleChartModel getMarketLastRoundsProductsBubble(Game game, Round deadlineRound);
	
	/**
	 * Company marketing decisions for all possible rounds
	 * @param company
	 * @return
	 */
	public LineChartModel getCompanyGameMarketingInvestments(User company);
	/**
	 * Company personal decisions for all possible rounds
	 * @param company
	 * @return
	 */
	public LineChartModel getCompanyGameEmployerInvestments(User company);
	/**
	 * Company rd decisions for all possible rounds
	 * @param company
	 * @return
	 */
	public LineChartModel getCompanyGameRDInvestments(User company);

	/**
	 * Returns the previous (before deadline) decisions of a specific company
	 * @param competitor
	 * @param deadlineRound
	 * @param exactRound
	 * @return
	 */
	public List<StatisticBean> getCompanyGameDecisions(User competitor,Round deadlineRound, boolean exactRound);
	/**
	 * Returns the previous (before deadline) companyProducts of a specific company
	 * @param competitor
	 * @param deadlineRound
	 * @param exactRound
	 * @return
	 */
	public List<StatisticBean> getCompanyGameCompanyProducts(User competitor,Round deadlineRound, boolean exactRound);
	
	/**
	 * Get companyProducts of different companies equal deadline
	 * @param game
	 * @param deadlineRound
	 * @return
	 */
	public List<StatisticBean> getMarketGameCompanyProducts(Game game,Round deadlineRound);
	
	/**
	 * Get companyDecisions of different companies equal deadline
	 * @param deadlineRound
	 * @return
	 */
	public List<StatisticBean> getMarketGameDecisionsDeadline(Round deadlineRound);
	
	/**
	 * Get companyDecisions of different companies equal deadline
	 * @param deadlineRound
	 * @param percentage
	 * @return
	 */
	public List<StatisticBean> getMarketGameDecisionsDeadlinePercentage(Round deadlineRound, double percentage, User company);
	
	/**
	 * Returns the previous (equal deadline) summed up decisions for all companies
	 * @param deadlineRound
	 * @author Patrick
	 * @return
	 */
	public List<StatisticBean> getMarketGameSummedUpDecisionsDeadline(Round deadlineRound);
	
	/**
	 * Get a specific amount (%) of agents with preferences
	 * = deadlineRound
	 * @param round
	 * @param percentage
	 * @author Patrick
	 * @return
	 */
	public List<StatisticBean> getMarketGameAgentPercentage(Round round, double percentage);
	
	/**
	 * Get the average preferences of a specific amount (%) of agents
	 * = deadline round
	 * @param round
	 * @param percentage
	 * @author Patrick
	 * @return
	 */
	public List<StatisticBean> getMarketGameAgentPreferencesPercentage(Round round, double percentage);
	
	/**
	 * Returns the amount of agents equal deadlineRound
	 * @param game
	 * @param deadlineRound
	 * @author Patrick
	 * @return
	 */
	public Integer getMarketGameAgentAmount(Game game, Round deadlineRound);
	
	/**
	 * Returns the amount of different values equal deadlineRound
	 * @param deadlineRound
	 * @author Patrick
	 * @return
	 */
	public List<StatisticBean> getMarketGameAmounts(Round deadlineRound);


}